#ifndef xpack_lang_cxx_ignore_case
#define xpack_lang_cxx_ignore_case
#pragma push_macro("xuser")
#undef  xuser
#define xuser mixc::lang_cxx::inc
#include"define/base_type.hpp"
#include"lang/cxx.hpp"
#include"lang/wxx/to_lower.hpp"
#include"lang/wxx.hpp"
#include"macro/xcmp.hpp"
#include"meta/is_base_char.hpp"
#include"meta/unsigned_type.hpp"
#pragma pop_macro("xuser")

namespace mixc::lang_cxx{
    struct invalid{};
}

namespace mixc::lang_cxx::origin{
    template<class char_t>
    constexpr auto ignore_case = invalid{};

    template<inc::is_base_char char_t>
    constexpr auto ignore_case<char_t> = 
        xcmp_global(char_t) {
            using u_t = inc::unsigned_type<char_t>;
            return 
                (ixx)(u_t)inc::wxx<char_t>(left).to_lower() - 
                (ixx)(u_t)inc::wxx<char_t>(right).to_lower();
        };
    
    template<inc::is_cxx cxx_t>
    constexpr auto ignore_case<cxx_t> = 
        xcmp_global(cxx_t) {
            return left.compare(right, ignore_case<typename cxx_t::item_t>);
        };
}

#endif
